﻿using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace GooNews.Controls
{
  /// <summary>
  /// 
  /// </summary>
	public partial class BusyPane : UserControl
	{
    /// <summary>
    /// Initializes a new instance of the <see cref="BusyPane"/> class.
    /// </summary>
		public BusyPane()
		{
			// Required to initialize variables
			InitializeComponent();
		}


    #region ObscuredBrush (DependencyProperty)

    /// <summary>
    /// A description of the property.
    /// </summary>
    public Brush ObscuredBrush
    {
      get { return (Brush)GetValue(ObscuredBrushProperty); }
      set { SetValue(ObscuredBrushProperty, value); }
    }
    public static readonly DependencyProperty ObscuredBrushProperty =
        DependencyProperty.Register("ObscuredBrush", typeof(Brush), typeof(BusyPane),
        new PropertyMetadata(new SolidColorBrush(Color.FromArgb(0xE0, 0x00, 0x00, 0x00)), new PropertyChangedCallback(OnObscuredBrushChanged)));

    private static void OnObscuredBrushChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
    {
      ((BusyPane)d).OnObscuredBrushChanged((Brush)e.NewValue);
    }

    protected virtual void OnObscuredBrushChanged(Brush newBrush)
    {
      ((Grid)this.Content).Background = newBrush;
    }

    #endregion

	}
}